package com.jfunit.java.bean;

import java.util.Map;

import com.jfunit.java.util.CastUtil;

/**
 * 请求参数对像
 * @author Administrator
 *
 */
public class Params {

    private Map<String, Object> fieldMap;

    public Params(Map<String, Object> fieldMap) {
        super();
        this.fieldMap = fieldMap;
    }
    
    /**
     * 获取所有字段信息
     * @return
     */
    public Map<String, Object> getFieldMap() {
        return fieldMap;
    }

    private Object get(String name) {
        return fieldMap.get(name);
    }
    
    public String getString(String name) {
        return CastUtil.castString(get(name));
    }

    public double getDouble(String name) {
        return CastUtil.castDouble(get(name));
    }

    public long getLong(String name) {
        return CastUtil.castLong(get(name));
    }

    public int getInt(String name) {
        return CastUtil.castInt(get(name));
    }

   
}
